#docker rmi -f bitnami/elasticsearch:7.15.1
docker pull bitnami/elasticsearch:7.15.1
rm -rf /cardone/docker/images/bitnami/elasticsearch_7.15.1.tar
mkdir -p /cardone/docker/images/bitnami
docker save bitnami/elasticsearch:7.15.1 > /cardone/docker/images/bitnami/elasticsearch_7.15.1.tar
#docker load < /cardone/docker/images/bitnami/elasticsearch_7.15.1.tar


# docker node update --label-rm cardone-elasticsearch_elasticsearch-1 cardone-01-01
docker node update --label-add cardone-elasticsearch_elasticsearch-1=true cardone-01-05

docker stack rm cardone-elasticsearch

docker stack deploy -c /cardone/middlewares/elasticsearch/prod.yml cardone-elasticsearch

for i in {1..10} 
do  
sleep $i

docker stack ps cardone-elasticsearch

docker service ls
done

docker service logs cardone-elasticsearch_elasticsearch-1 -f --tail 300
